package com.scuec.groupfive.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;

@Mapper
public interface PostFavoriteMapper {
    @Select("SELECT COUNT(*) FROM post_favorites")
    int getTotalFavoriteCount();

    @Select("SELECT COUNT(*) FROM post_favorites WHERE post_id = #{postId}")
    int getFavoriteCountByPostId(Long postId);

    @Select("SELECT COUNT(*) FROM post_favorites WHERE created_at BETWEEN #{startDate} AND #{endDate}")
    int getFavoriteCountByDateRange(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
}